<template lang="jade">
div
	// h-loader-full(url='loader',:setdata='false')
	// h-data-adder(url='add/msg')
	m-title(icon='add',name='添加系统消息')
	table.single
		mf-row(name='内容'): input(type='text',v-model='list.msg')
		mf-row(name='消息类别', msg='必选项')
			select(v-model='list.type')
				option(v-for='v in msg_1',:value='v.type') {{v.name}}
		mf-row(name='消息类别')
			button(@click='but') 确认提交
</template>

<script>
export default {
	data () {
		return {
			list: {},
			msg_1:[{type:0,name:'系统消息'},{type:1,name:'用户欢迎消息'}]
		}
	},
	methods: {
		but(){
			console.log(this.list)
			this.$ajax.post('add/msg',this.list,(res)=>{
				// console.log(this.list)
				this.$msg.success(res.message)
				setTimeout('window.location.reload()',1500)
			},(res)=>{
				console.log(2)
				this.$msg.error(res.message)
			})
		}
		// addAfter (res) {
		// 	this.$msg.success()
		// 	window.location.reload()
		// }
	}
}
</script>
<style>
	img{width:80px;}
	.page{ float:right; }
		.page a{background: #4db3ff; color: #fff; padding:3px 10px; border-radius:4px; cursor:pointer;}
		.page b{margin:0 10px;}
</style>